import type { PlusColumn } from 'plus-pro-components'

export function useForm() {
    const schema: PlusColumn[] = [
        {
            colProps: {
                span: 8,
            },
            fieldProps: {
                placeholder: '请输入',
            },
            label: '权益类型',
            options: [
                {
                    color: 'red',
                    label: '专属特权',
                    value: 0,
                },
                {
                    color: 'blue',
                    label: '消费折扣',
                    value: 1,
                },
            ],
            prop: 'type',
            valueType: 'select',
        },
        {
            colProps: {
                span: 8,
            },
            fieldProps: {
                placeholder: '请输入',
            },
            label: '权益名称',
            prop: 'name',
            valueType: 'copy',
        },

        // {
        //     colProps: {
        //         span: 6,
        //     },
        //     label: '顺序',
        //     options: async () => [
        //         {
        //             label: '升序',
        //             value: 'asc',
        //         },
        //         {
        //             label: '降序',
        //             value: 'desc',
        //         },
        //     ],
        //     prop: 'order',
        //     valueType: 'select',
        // },
    ] as const

    const form = ref({
        name: '',
        type: '',
    })
    return { form, schema }
}
